/*
 * Copyright (C) 2004-2006  Autodesk, Inc.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of version 2.1 of the GNU Lesser
 * General Public License as published by the Free Software Foundation.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*
*
*/

#include "stdafx.h"
#include "Fdo.h"
#include "FdoWcsOvCoverageDefinition.h"
#include "FdoWcsOvBoundingBoxDefinition.h"

#include "FDO\Providers\WCS\Override\mgOvCoverageDefinition.h"
#include "FDO\Providers\WCS\Override\mgObjectFactory.h"
//#include "FDO\Providers\WCS\Override\mgOvStyleDefinition.h"

NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::OvCoverageDefinition() : NAMESPACE_OSGEO_FDO_COMMANDS_SCHEMA::PhysicalElementMapping(System::IntPtr::Zero, false)
{
    EXCEPTION_HANDLER(Attach(IntPtr(FdoWcsOvCoverageDefinition::Create()), true))
}

NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::OvCoverageDefinition(System::IntPtr unmanaged, System::Boolean autoDelete) : NAMESPACE_OSGEO_FDO_COMMANDS_SCHEMA::PhysicalElementMapping(unmanaged, autoDelete)
{

}

FdoWcsOvCoverageDefinition* NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::GetImpObj()
{
    return static_cast<FdoWcsOvCoverageDefinition*>(UnmanagedObject.ToPointer());
}

IntPtr NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::GetDisposableObject()
{
    return IntPtr(static_cast<FdoIDisposable*>(GetImpObj()));
}

String^ NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::Identifier::get()
{
    FdoString* result;

    EXCEPTION_HANDLER(result = GetImpObj()->GetIdentifier())

    return CHECK_STRING(result);
}

System::Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::Identifier::set(String^ value)
{
    EXCEPTION_HANDLER(GetImpObj()->SetIdentifier(StringToUni(value)))
}

String^ NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::ImageFormat::get()
{
    FdoString* result;

    EXCEPTION_HANDLER(result = GetImpObj()->GetImageFormat())

    return CHECK_STRING(result);
}

System::Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::ImageFormat::set(String^ value)
{
    EXCEPTION_HANDLER(GetImpObj()->SetImageFormat(StringToUni(value)))
}

NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition^ NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::BoundingBox::get()
{
    FdoWcsOvBoundingBoxDefinition* result;

    result = GetImpObj()->GetBoundingBox();

    return gcnew NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition(result);
}

System::Void NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvCoverageDefinition::BoundingBox::set(NAMESPACE_OSGEO_FDO_PROVIDERS_WCS_OVERRIDE::OvBoundingBoxDefinition^ value)
{
    EXCEPTION_HANDLER(GetImpObj()->SetBoundingBox(value->GetImpObj()))
}
